package com.lsege.service.sys;

import com.lsege.entity.sys.AppMenu;
import com.lsege.entity.sys.HelpingInfo;
import com.lsege.mapper.sys.HomeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/9/13.
 */
@Service
public class HomeServiceImpl implements HomeService {

    @Autowired
    HomeMapper homeMapper;

    @Override
    public List<AppMenu> queryAllAppMenuByPage(Integer pageNum,Integer pageSize) {
        Integer startPage = (pageNum-1)*pageSize;
        return homeMapper.queryAllAppMenuByPage(startPage,pageSize);
    }

    @Override
    public Long queryAllAppMenuCount() {
        return homeMapper.queryAllAppMenuCount();
    }

    @Override
    public void editMenu(Long id, String title, String status) {
        homeMapper.editMenu(id,title,status);
    }

    @Override
    public List<HelpingInfo> queryHeleInfoByTypeAndPage(String types,Integer pageNum,Integer pageSize) {
        Integer startPage = (pageNum - 1) * pageSize;
        return homeMapper.queryHeleInfoByTypeAndPage(types,startPage,pageSize);
    }

    @Override
    public Long queryHeleCount(String types) {
        return homeMapper.queryHeleCount(types);
    }

    @Override
    public List<HelpingInfo> queryImage(Integer pageNum,Integer pageSize) {
        Integer startPage = (pageNum - 1) * pageSize;
        return homeMapper.queryImage(startPage,pageSize);
    }

    @Override
    public Long queryImageCount() {
        return homeMapper.queryImageCount();
    }

    @Override
    public String queryDetailsById(Long id) {
        return homeMapper.queryDetailsById(id);
    }

    @Override
    public void deleteDetails(Long id) {
        homeMapper.deleteDetails(id);
    }

    @Override
    public void uploadDetails(String type, String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
        homeMapper.uploadDetails(type,s1,s2,s3,s4,s5,s6,s7,s8);
    }

    @Override
    public void editHuZhuDetails(String id, String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
        homeMapper.editHuZhuDetails(id,s1,s2,s3,s4,s5,s6,s7,s8);
    }
}
